Skip to content

feat(nav): add about mega-menu and magic-pill navbar motion#304

Merged
yasinmiran merged 5 commits into
mainfrom
feat/nav-about-mega-menu
Jun 12, 2026
Merged

feat(nav): add about mega-menu and magic-pill navbar motion#304
yasinmiran merged 5 commits into
mainfrom
feat/nav-about-mega-menu

Conversation

@yasinmiran

Copy link
Copy Markdown
Collaborator

Summary

  • Add an About mega-menu: a two-column dropdown on desktop (5 university nodes + 4 sub-pages) and an accordion on mobile, both rendered from one shared component. The node list is derived from src/data/organizations.ts, so it can't drift from the org data.
  • Add a framer-motion "magic pill" that follows the hovered desktop link and springs back to the active page.
  • About text still links to /about; a separate chevron <button> toggles the menu — click/keyboard is the canonical path, hover-intent open is a progressive enhancement gated to hover: hover pointers, with Esc + outside-click close and focus return.

Changes

  • New src/data/nav-menu.ts — menu data (nodes derived from organizations.ts, 4 fixed sections, overview href).
  • New src/components/nav-about-menu.tsx — shared panel/accordion content (panel/accordion variants).
  • Rewrite src/components/navigation.tsx — magic-pill glider, desktop About dropdown, mobile About accordion.
  • No route, content-collection, or schema changes. Existing navbar behavior preserved (floating glass pill, scroll state, search, theme toggle, animated hamburger, dark mode).

Accessibility

  • Chevron has aria-expanded/aria-controls; Esc closes and restores focus; focus-visible:ring-accent on all interactive elements; aria-current="page" on the active node/section; brand-color dots are decorative (aria-hidden); mobile chevron is a 44px target; fully operable without hover. All motion gated behind useReducedMotion().

Test plan

  • astro check — 0 errors
  • pnpm build — 184 pages built, Pagefind indexed 183
  • pnpm test:slugs — all valid
  • pnpm test:pages — 183/183 pages + 185/185 assets HTTP 200
  • Playwright (desktop): panel opens/closes via chevron + keyboard; Esc closes and restores focus to the chevron; all node/section hrefs correct; About text navigates to /about; magic pill rests on the active link and glides to the hovered link; two-column grid with no viewport overflow; dark-mode accent legible
  • Playwright (mobile): About accordion expands with all 10 links; 44px chevron target
  • No nav-attributable console errors

Copilot AI review requested due to automatic review settings June 4, 2026 13:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the site navigation by adding an “About” mega-menu (desktop dropdown + mobile accordion) driven from shared data, and introducing a framer-motion “magic pill” hover/active indicator for the desktop navbar.

Changes:

  • Added src/data/nav-menu.ts to centralize About menu data (including node links derived from src/data/organizations.ts).
  • Added src/components/nav-about-menu.tsx to render shared About menu content for both desktop (“panel”) and mobile (“accordion”) variants.
  • Reworked src/components/navigation.tsx to integrate the About dropdown/accordion behaviors and the magic-pill glider animation, including reduced-motion gating and keyboard/outside-click close handling.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/data/nav-menu.ts Defines About menu data, deriving node links from organizations.ts to avoid drift.
src/components/nav-about-menu.tsx Implements the shared About menu UI for desktop panel and mobile accordion variants.
src/components/navigation.tsx Integrates the About mega-menu + mobile accordion and adds the magic-pill hover/active indicator.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…odes

Pull the magic-pill mechanics into a useMagicPill hook and the desktop and
mobile disclosures into NavDropdown and NavMobileAccordion, leaving
navigation.tsx a lean orchestrator and the pieces reusable on their own.

Drop the "Explore" sections column from the About menu so it lists only the
five org nodes plus the overview link; the menu data sheds the now-unused
section types. Also gate the mobile hamburger morph on reduced-motion for
consistency with the rest of the nav.
@yasinmiran yasinmiran merged commit 5394fba into main Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants